initial ICD loader environment variable support#77
initial ICD loader environment variable support#77kepatil merged 6 commits intoKhronosGroup:masterfrom
Conversation
c8910a1 to
501d36e
Compare
501d36e to
ed3e2a6
Compare
|
I've rebased these changes so there are no longer any merge conflicts. Unless there are review comments, this PR is ready to go. |
|
Can somebody please review and merge these changes? @nikhiljnv or @alycm perhaps? |
| | Environment Variable | Behavior | Example Format | | ||
| |:---------------------------------:|---------------------|----------------------| | ||
| | OCL_ICD_FILENAMES | Specifies a list of additional ICDs to load. The ICDs will be enumerated first, before any ICDs discovered via default mechanisms. | `export OCL_ICD_FILENAMES=libVendorA.so:libVendorB.so`<br/><br/>`set OCL_ICD_FILENAMES=vendor_a.dll;vendor_b.dll` | | ||
| | OCL_ICD_VENDORS | On Linux and Android, specifies a directory to scan for ICDs to enumerate in place of the default `/etc/OpenCL/vendors'. | `export OCL_ICD_VENDORS=/my/local/icd/search/path` | |
There was a problem hiding this comment.
If we allow paths in OCL_ICD_ENTRIES as suggested above, I think this is not needed anymore?
There was a problem hiding this comment.
No, I think we should support both options as they have different uses:
OCL_ICD_VENDORS still uses the .icd files, but it reads them from a different directory than /etc/OpenCL/vendors. It is only valid on Linux and Android (and probably OSX as well, when using the ICD loader).
OCL_ICD_FILENAMEs is used to explicitly load the specified ICDs, without requiring any .icd files. It works on all OSes.
* basic ICD loader env var support for OCL_ICD_VENDORS * added envvars source files * added OCL_ICD_FILENAMES support * added README section describing debug environment variables * refactored platform specific defines into icd_platform.h * disable tracing
This change adds initial support for ICD loader environment variables, see #48.
The environment variable support was largely ported from the Vulkan ICD loader, so it uses the same
secure_getenv()function when available.I've added support for two environment variables for now, which I have documented in the README:
export OCL_ICD_FILENAMES=libVendorA.so:libVendorB.soset OCL_ICD_FILENAMES=vendor_a.dll;vendor_b.dllexport OCL_ICD_VENDORS=/my/local/icd/search/pathAdditional environment variables could be added in the future, see for example #45.